import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

const actions = {};

const mutations = {
    setAddress1(state, data) {
        state.address1 = data;
    },
    setAddress2(state, data) {
        state.address2 = data;
    },
    setDeliverGoods(state, data) {
        state.deliverGoods = data;
        uni.setStorageSync('deliverGoods',data);
    },

};

// State: 用于存储数据
const state = {
    address1: {},
    address2: {},
    deliverGoods:uni.getStorageSync('deliverGoods') || {},//送货参数
};

// 创建并导出 store
export default new Vuex.Store({
    actions,
    mutations,
    state,
});
